home *** CD-ROM | disk | FTP | other *** search
Wrap
property spriteNum, myCursorType, myBuiltInCursor, myCursorMember, myCustomCursor, myCustomMask, mySprite, mySavedCursor on beginSprite me SetSpriteCursor(me) end on endSprite me mySprite.cursor = mySavedCursor end on SetSpriteCursor me if spriteNum < 1 then if the runMode = "Author" then ErrorAlert(me) end if end if mySprite = sprite(me.spriteNum) mySavedCursor = mySprite.cursor if voidp(myCursorType) then mySprite.cursor = myBuiltInCursor exit end if case myCursorType of "Built-in cursor": mySprite.cursor = myBuiltInCursor "Cursor member": myCursorMember = value(myCursorMember) cursorList = [myCursorMember.number] mySprite.cursor = cursorList "1 bit bitmap": myCustomCursor = value(myCustomCursor) cursorList = [myCustomCursor.number] if myCustomMask <> "no mask" then myCustomMask = value(myCustomMask) cursorList.append(myCustomMask.number) end if mySprite.cursor = cursorList end case end on ErrorAlert me behaviorName = string(me) delete word 1 of behaviorName delete char -30001 of behaviorName delete char -30001 of behaviorName alert("BEHAVIOR ERROR: Frame " & the frame & ", Sprite " & me.spriteNum & RETURN & RETURN & "Behavior " & behaviorName & "has been attached to the frame." & RETURN & RETURN & "It will have no effect, and should be removed from the behavior channel.") end on getPropertyDescriptionList me if not (the currentSpriteNum) then exit end if propertyDescriptionList = [:] cursorTypes = [] cursorMembersList = GetCursorMembers(me) cursorBitmapsList = GetCursorBitmaps(me) cursorMasksList = duplicate(cursorBitmapsList) cursorMasksList.addAt(1, "no mask") cursorMembers = cursorMembersList.count() bitmapCursors = cursorBitmapsList.count() if cursorMembers then cursorTypes.append("Cursor member") end if if bitmapCursors then cursorTypes.append("1 bit bitmap") end if if cursorTypes.count() then cursorTypes.addAt(1, "Built-in cursor") propertyDescriptionList.addProp(#myCursorType, [#comment: "CHOICE OF TYPE - Use which type of cursor?", #format: #string, #range: cursorTypes, #default: cursorTypes[1]]) propertyDescriptionList.addProp(#myBuiltInCursor, [#comment: "CHOICE OF CURSOR - Built-in cursor:", #format: #cursor, #default: 280]) else return [#myBuiltInCursor: [#comment: "Use which cursor?", #format: #cursor, #default: 280]] end if if cursorMembers then propertyDescriptionList.addProp(#myCursorMember, [#comment: "- Cursor member:", #format: #member, #range: cursorMembersList, #default: cursorMembersList[1]]) end if if bitmapCursors then propertyDescriptionList.addProp(#myCustomCursor, [#comment: "- 1 bit bitmap (image):", #format: #bitmap, #range: cursorBitmapsList, #default: cursorBitmapsList[1]]) propertyDescriptionList.addProp(#myCustomMask, [#comment: "1 bit bitmap (mask):", #format: #bitmap, #range: cursorMasksList, #default: cursorMasksList[1]]) end if return propertyDescriptionList end on GetCursorMembers me cursorMembersList = [] maxCastLib = the number of castLibs repeat with theCastLib = 1 to maxCastLib maxMember = the number of castMembers of castLib theCastLib repeat with memberNumber = 1 to maxMember theMember = member(memberNumber, theCastLib) if theMember.type = #cursor then if theMember.name = EMPTY then cursorMembersList.append(theMember) next repeat end if cursorMembersList.append(theMember.name) end if end repeat end repeat return cursorMembersList end on GetCursorBitmaps me cursorBitmapsList = [] maxCastLib = the number of castLibs repeat with theCastLib = 1 to maxCastLib maxMember = the number of castMembers of castLib theCastLib repeat with memberNumber = 1 to maxMember theMember = member(memberNumber, theCastLib) if theMember.type = #bitmap then if theMember.depth > 1 then next repeat end if if theMember.width > 20 then next repeat end if if theMember.height > 20 then next repeat end if if theMember.name = EMPTY then cursorBitmapsList.append(theMember) next repeat end if cursorBitmapsList.append(theMember.name) end if end repeat end repeat return cursorBitmapsList end